package com.zero.dubbo.dao;

import com.zero.dubbo.model.User;
import org.springframework.stereotype.Service;

import javax.validation.ConstraintViolationException;

@Service
public class UserRpcServiceImpl implements IUserRpcService {


    @Override
    public User get(Integer id) {
        User user = new User();
        user.setId(id);
        user.setName("wql" + id);
        user.setGender(id % 2 + 1);
        return user;
    }

    @Override
    public Integer add(User user) throws ConstraintViolationException {
        return (int) (System.currentTimeMillis() / 1000);
    }
}
